1. Field of the Invention
The present invention relates to computer operating systems and more particularly to operating system features that serialize access to computer system resources. More particularly, the present invention relates to a method of serializing resource access for interrupt processing without requiring spinning or interrupt disablement over the critical interrupt processing code section protected by the invention.
2. Background of the Invention
Multiprocessing computer systems are computers with more than one processor (Central Processing Unit or CPU) for executing instructions. Operating systems for multiprocessing computer systems dispatch tasks to each processor for execution according to scheduling algorithms designed to maximize system throughtput.
Multiprocessing systems, such as the IBM ES/9000 family of computers, frequently share resources between the processors including memory, permanent storage devices, such disks or tapes, and other peripheral devices such as communications controllers. These devices operate serially, that is, they must complete processing associated with a request from a first processing unit before beginning processing of the next request. Control of access to resources is termed "serialization" meaning that requests access to a resource are ordered and processed one at a time.
Operating systems generally have at least two levels of programming code: process level code and interrupt level code. Process level code is the program code that performs the necessary processing to calculate a number or request that data be stored to a file. Interrupt level code processes exceptions generated as interrupts from the various resources. Interrupts are used because the peripheral devices such as disks, tapes, and to a lesser extent memory operate at speeds much slower than the processor. A processor may request that a file be stored on a disk (in process level code). Once started, the processor suspends that task until the storing is completed. The disk resource signals the processor that it has completed by sending an interrupt. This interrupt may or may not be processed by the processor initially requesting the resource action. The interrupt must be processed on a priority basis and may require certain actions by the processor to continue work. Access to the interrupt code must be serialized so that no more than one processor is taking action with respect to a single resource at one point in time.
Serialization of process access to resources has typically involved the establishment of a "lock" on that resource. The lock can be held by at most one processor at a time. The lock is frequently implemented as a location in memory that contains one pattern of data when available and another when in use. A process seeking to obtain a lock can typically take one of two actions if the lock is presently held by another processor: it may suspend, placing the requesting process in a wait state and passing control to a runnable process; or it may spin, periodically checking to see whether or not the lock has been released. Each of these techniques has certain advantages and disadvantages. The suspend action increases the overhead as the processor must undergo the context switching overhead of changing processes. It has the advantage of using processor time more efficiently by continuing work on another pending processes. The spin lock has the disadvantage of consuming system resources continuously checking to determine whether the lock is available. It has the advantage of being able to quickly begin processing once the lock is freed.
A further disadvantage in spin lock implementations is the requirement that interrupts be disabled while the spin lock is held. Disabling of interrupts tends to degrade processor performance and is generally undesirable.
Prior art systems for serializing resource access have employed both suspend and spin locks. For example, U.S. Pat. No. 4,663,709 to Fujiwara et al., describes a serialization control system for serializing access to shared data. U.S. Pat. No. 4,604,694 to Hough (commonly assigned) discloses a method of controlling shared and exclusive access to a resource by establishing deferred task queues. U.S. Pat. No. 4,271,468 to Christensen et al., discloses apparatus and methods for handling input/output unit interrupts. Each of these systems, however, suffers from the loss of efficiency due to locking overhead and disablement of interrupts.
Thus, a problem exists in increasing the performance of a multiprocessing system by reducing the overhead of serialization. This technical problem includes reducing processor overhead consumed by spin locks and reducing inefficiencies introduced by running the process level code disabled for interrupts.